package com.yjtc.cbg.retrofitsearchdemo.factory;


import retrofit2.GsonConverterFactory;
import retrofit2.Retrofit;
import retrofit2.RxJavaCallAdapterFactory;

/**
 * Created by chenboge on 16/7/10.
 */
public class serviceFactory {

    public static <T> T createServiceForm(final Class<T> tClass,String api) {
        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl(api)
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .build();
        return retrofit.create(tClass);
    }
}
